﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using BCService.OA.BusinessFlow;
using BlackCoffeeRESTful.Configs;

namespace BlackCoffeeRESTful.Controllers.Management.OA.BusinessFlow
{
    /// <summary>
    /// OA系统业务流引擎手动模式
    /// </summary>
    [ApiExplorerSettings(GroupName = "OAAdmin")]
    [Route("api/v1/sim/[controller]")]
    public class BusinessFlowController : ManagementBaseController
    {
        private readonly IBusinessFlowService businessFlowService;

        public BusinessFlowController(IBusinessFlowService businessFlowService)
        {
            this.businessFlowService = businessFlowService;
        }

        #region 业务流手动初始化
        /// <summary>
        ///  业务流手动初始化
        /// </summary>
        /// <param name="businessFlowRecordId">业务流记录Id</param>
        /// <response code="204">业务流初始化完毕</response>
        /// <returns></returns>
        [HttpPut("[action]/{business_flow_record_id}")]
        [Log("添加OA系统业务流模型")]
        public IActionResult Init([FromRoute(Name = "business_flow_record_id")]long businessFlowRecordId)
        {
            this.businessFlowService.Init(businessFlowRecordId);
            return NoContent();
        }
        #endregion
    }
}
